//
//  KCFeedPost.m
//  KConnect
//
//  Created on 18/03/09.
//  Copyright 2009 Xtreme Labs Inc. All rights reserved.
//

#import "KCFeedPost.h"


#define kFeedPost     @"fdp"

#define kPosterUID    @"s" 
#define kTemplateID   @"t"
#define kPostType     @"pt" //The type of feed post
#define kType         @"tu"

#define kDefaultTypeValue @"fdp"

#define kSubType1     @"st1"
#define kSubType2     @"st2" 


@implementation KCFeedPost

- (id)initWithPosterUID:(NSString*)posterUID
{
  NSDictionary *required = [NSDictionary dictionaryWithObjectsAndKeys:
                            posterUID,          kPosterUID, 
                            kDefaultTypeValue,  kType,      
                            nil];

  
  if (self = [super initWithParameters:required])
  {
    
  }
  
  return self;
}

- (void)setTemplateID:(NSInteger)idNumber
{
   [self addOptionalParameter:kTemplateID value:[NSString stringWithFormat:@"%d", idNumber]];   
}

- (void)setPostType:(KCPostType)type
{
   [self addOptionalParameter:kPostType value:[NSString stringWithFormat:@"%d", type]];  
}

- (void)setSubType1:(NSString*)subtype
{
  [self addOptionalParameter:kSubType1 value:subtype];  
}

- (void)setSubType2:(NSString*)subtype
{
  [self addOptionalParameter:kSubType2 value:subtype];
}


#pragma mark KCMessage Subclass
- (NSString*)messageType
{
  return kFeedPost;
}

- (NSArray*)requiredParameters
{
  return [NSArray arrayWithObjects:
          kPosterUID,
          kType,
          nil];
}

- (NSArray*)optionalParameters
{
	return [NSArray arrayWithObjects:
          kTemplateID,
          kPostType,
          kSubType1,
          kSubType2,
          nil];
}


@end
